/*
 * Copyright (c) 2006-2021, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2022-05-29     vandoul       the first version
 */
#ifndef APPLICATIONS_SRV_MQTT_H_
#define APPLICATIONS_SRV_MQTT_H_

#ifdef __cplusplus
extern "C" {
#endif

struct srv_mqtt_data {
    char *topic;
    int qos;
    void *buff;
    uint32_t size;
    int rsp_num;
};

struct srv_mqtt_config {
    char name[16];
    char *url;
    char *prefix;
};

int srv_mqtt_create(struct srv_mqtt_config *cfg);
int srv_mqtt_start(int srv_num);
int srv_mqtt_trans(int srv_num, struct srv_mqtt_data *data);
int srv_mqtt_get_srv_num(char *name);

#ifdef __cplusplus
}
#endif

#endif /* APPLICATIONS_SRV_MQTT_H_ */
